using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Number : MonoBehaviour
{
    public Button Byte1;
    public Button Byte2;
    public Button Byte;
    public Text num;

    public void ChangeNum()
    {
        if(Byte != null)
        {
            num.text = Byte.GetComponent<changeColor>().state ? "1" : "0";
            return;
        }
        else
        {
            bool state1 = Byte1.gameObject.GetComponent<changeColor>().state;
            bool state2 = Byte2.gameObject.GetComponent<changeColor>().state;
            int b1;
            int b2;
            b1 = Byte1.GetComponent<changeColor>().state ? 1 : 0;
            b2 = Byte2.GetComponent<changeColor>().state ? 1 : 0;
            int digit = b1 * 2 + b2;
            num.text = Convert.ToString(digit);
        }
    }
}
